rewrite rule

rewrite rule

am 10.03.2010 19:42:55 von Richard Schoenig

------_=_NextPart_001_01CAC081.8038D8D6
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I am new to using mod_rewrite and have been trying to create a rule to=0D
do something rather simple, but keep hitting a wall. I have been trying=0D
to research online how to do it, but I keep finding global changes and=0D
not specific to what I am trying to do. Essentially I am looking to use=0D
a rewrite rule to redirect users in an application from=0D
=0D
=0D
=0D
http://server4/perl.pl?n=3D1 to http://server1/perl.pl?n=3D1=0D
=0D
=0D
=0D
=0D
=0D
I tried using =0D
=0D
RewriteEngine on=0D
=0D
Options +FollowSymlinks=0D
=0D
RewriteCond %{QUERY_STRING} ^n=3D1$=0D
=0D
RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
=0D
RewriteCond %{QUERY_STRING} ^n=3D2$=0D
=0D
RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
=0D
RewriteCond %{QUERY_STRING} ^n=3D3$=0D
=0D
RewriteRule ^$ http://mypcname/perl.pl [L]=0D
=0D
=0D
=0D
=0D
=0D
=0D
=0D
To test on my local host but I am guessing that it is not even close to=0D
what I want to do.=0D
=0D
=0D
=0D
=0D
=0D

The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.=0D


------_=_NextPart_001_01CAC081.8038D8D6
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:m=3D"http://schema=
s.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html=
40">=0D
=0D
=0D
=
=0D
=0D
=0D
=0D
=0D
=0D
=0D
=0D

=0D
=0D

I am new to using mod_rewrite and have been trying to =
create=0D
a rule to do something rather simple, but keep hitting a wall.  I have=
=0D
been trying to research online how to do it, but I keep finding global chan=
ges=0D
and not specific to what I am trying to do.  Essentially I am looking =
to=0D
use a rewrite rule to redirect users in an application from

=
=0D
=0D

 

=0D
=0D

erl.pl?n=3D1">http://server4/perl.pl?n=3D1 =0D
to http=
://server1/perl.pl?n=3D1

=0D
=0D

 

=0D
=0D

 

=0D
=0D

I tried using

=0D
=0D

RewriteEngine on

=0D
=0D

Options +FollowSymlinks

=0D
=0D

RewriteCond %{QUERY_STRING}  ^n=3D1$ p>=0D
=0D

RewriteRule ^$ http://127.0.0.1/ perl.pl [L] >

=0D
=0D

RewriteCond %{QUERY_STRING}  ^n=3D2$ p>=0D
=0D

RewriteRule ^$ http://127.0.0.1/ perl.pl [L] >

=0D
=0D

RewriteCond %{QUERY_STRING}  ^n=3D3$ p>=0D
=0D

RewriteRule ^$ http://mypcname/perl.pl [L]<=
/p>=0D
=0D

 

=0D
=0D

 

=0D
=0D

 

=0D
=0D

To test on my local host but I am guessing that it is =
not=0D
even close to what I want to do.

=0D
=0D

 

=0D
=0D

:auto'> 

=0D
=0D
=0D
=0D
The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.
=0D
=0D
=0D

------_=_NextPart_001_01CAC081.8038D8D6--

Re: rewrite rule

am 11.03.2010 05:56:38 von Nilesh Govindrajan

On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig
wrote:
> I am new to using mod_rewrite and have been trying to create a rule to do
> something rather simple, but keep hitting a wall.=A0 I have been trying t=
o
> research online how to do it, but I keep finding global changes and not
> specific to what I am trying to do.=A0 Essentially I am looking to use a
> rewrite rule to redirect users in an application from
>
>
>
> http://server4/perl.pl?n=3D1=A0 to http://server1/perl.pl?n=3D1
>
>
>
>
>
> I tried using
>
> RewriteEngine on
>
> Options +FollowSymlinks
>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D1$
>
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D2$
>
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
>
> RewriteCond %{QUERY_STRING}=A0 ^n=3D3$
>
> RewriteRule ^$ http://mypcname/perl.pl [L]
>
>
>
>
>
>
>
> To test on my local host but I am guessing that it is not even close to w=
hat
> I want to do.
>
>
>
>
>
> The information in this email is confidential and may be legally privileg=
ed.
> It is intended solely for the addressee. Access or use by any other perso=
n
> to this internet email is not authorized and may be unlawful. If you are =
not
> the intended recipient, please delete or destroy this email. If you do no=
t
> wish to receive future emails from this sender, please reply directly to
> this email requesting you be removed from any mailing list.

You want to redirect or rewrite ?

--=20
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: rewrite rule

am 11.03.2010 07:32:04 von Igor Cicimov

--001485e8eddebba2eb0481809201
Content-Type: text/plain; charset=ISO-8859-1

>
> http://server4/perl.pl?n=1 to http://server1/perl.pl?n=1
>

You can't test it on the localhost since you are redirecting some page to
itself => infinite loop

Try redirecting to some imaginary domain or google.com


RewriteCond %{QUERY_STRING} ^(n=[0-9]+)$
RewriteRule ^/perl.pl$ http://google.com/perl.pl?%1 [R,L]

and if the browser gets back the googles 404 page not found and your address
bar looks like "http://www.google.com/perl.pl?n=1" => your rule is good


Igor


On Thu, Mar 11, 2010 at 3:56 PM, Nilesh Govindarajan wrote:

> On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig
> wrote:
> > I am new to using mod_rewrite and have been trying to create a rule to do
> > something rather simple, but keep hitting a wall. I have been trying to
> > research online how to do it, but I keep finding global changes and not
> > specific to what I am trying to do. Essentially I am looking to use a
> > rewrite rule to redirect users in an application from
> >
> >
> >
> > http://server4/perl.pl?n=1 to http://server1/perl.pl?n=1
> >
> >
> >
> >
> >
> > I tried using
> >
> > RewriteEngine on
> >
> > Options +FollowSymlinks
> >
> > RewriteCond %{QUERY_STRING} ^n=1$
> >
> > RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
> >
> > RewriteCond %{QUERY_STRING} ^n=2$
> >
> > RewriteRule ^$ http://127.0.0.1/ perl.pl [L]
> >
> > RewriteCond %{QUERY_STRING} ^n=3$
> >
> > RewriteRule ^$ http://mypcname/perl.pl [L]
> >
> >
> >
> >
> >
> >
> >
> > To test on my local host but I am guessing that it is not even close to
> what
> > I want to do.
> >
> >
> >
> >
> >
> > The information in this email is confidential and may be legally
> privileged.
> > It is intended solely for the addressee. Access or use by any other
> person
> > to this internet email is not authorized and may be unlawful. If you are
> not
> > the intended recipient, please delete or destroy this email. If you do
> not
> > wish to receive future emails from this sender, please reply directly to
> > this email requesting you be removed from any mailing list.
>
> You want to redirect or rewrite ?
>
> --
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

--001485e8eddebba2eb0481809201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

204, 204, 204); padding-left: 1ex;" class=3D"gmail_quote"> http://server4/perl.pl?n=3D1" target=3D"_blank">http://server4/perl.pl?n=3D=
1
=A0
to http://=
server1/perl.pl?n=3D1


You can't test it =
on the localhost since you are redirecting some page to itself=A0 =3D> i=
nfinite loop


Try redirecting to some imaginary domain or m">google.com


  =A0 RewriteCond %{QUERY_STRING}=A0 ^(n=
=3D[0-9]+)$
  =A0 RewriteRule ^/perl.pl a>$ http://google.com/perl.pl?%1 a> [R,L]


and if the browser gets back the googles 404 page not found and your ad=
dress bar looks like "
=
http://www.google.com/perl.pl?n=3D1
" =3D> your rule is good
=



Igor


On Thu, Mar 11, 2010 at 3:56=
PM, Nilesh Govindarajan < h7.com" target=3D"_blank">lists@itech7.com> wrote:

r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<=
div>On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig

<Richard=
_Schoenig@picis.com
> wrote:

> I am new to using mod_rewrite and have been trying to create a rule to=
do

> something rather simple, but keep hitting a wall.=A0 I have been tryin=
g to

> research online how to do it, but I keep finding global changes and no=
t

> specific to what I am trying to do.=A0 Essentially I am looking to use=
a

> rewrite rule to redirect users in an application from

>

>

>

> http://serv=
er4/perl.pl?n=3D1
=A0 to =3D"_blank">http://server1/perl.pl?n=3D1

>

>

>

>

>

> I tried using

>

> RewriteEngine on

>

> Options +FollowSymlinks

>

> RewriteCond %{QUERY_STRING}=A0 ^n=3D1$

>

> RewriteRule ^$ http://=
127.0.0.1/
[L]=


>

> RewriteCond %{QUERY_STRING}=A0 ^n=3D2$

>

> RewriteRule ^$ http://=
127.0.0.1/
[L]=


>

> RewriteCond %{QUERY_STRING}=A0 ^n=3D3$

>

> RewriteRule ^$ h=
ttp://mypcname/perl.pl
[L]

>

>

>

>

>

>

>

> To test on my local host but I am guessing that it is not even close t=
o what

> I want to do.

>

>

>

>

>

> The information in this email is confidential and may be legally privi=
leged.

> It is intended solely for the addressee. Access or use by any other pe=
rson

> to this internet email is not authorized and may be unlawful. If you a=
re not

> the intended recipient, please delete or destroy this email. If you do=
not

> wish to receive future emails from this sender, please reply directly =
to

> this email requesting you be removed from any mailing list.



You want to redirect or rewrite ?



--

Nilesh Govindarajan

Site & Server Administrator





------------------------------------------------------------ ---------

The official User-To-User support forum of the Apache HTTP Server Project.<=
br>
See <URL: lank">http://httpd.apache.org/userslist.html> for more info.

To unsubscribe, e-mail: g" target=3D"_blank">users-unsubscribe@httpd.apache.org

=A0 " =A0 from the digest: @httpd.apache.org" target=3D"_blank">users-digest-unsubscribe@httpd.apache.=
org


For additional commands, e-mail: org" target=3D"_blank">users-help@httpd.apache.org






--001485e8eddebba2eb0481809201--

RE: rewrite rule

am 11.03.2010 16:56:42 von Richard Schoenig

------_=_NextPart_001_01CAC133.721C7D1E
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

So here is the issue I am having now I have separate servers I am trying=0D
to set this rule up on so that if a n=3D1 or an n=3D2 it accesses server 1,=
=0D
and if an n=3D3 then it accesses server 2=0D
=0D
=0D
=0D
The rules I have setup are on server 2 I have it configured like this=0D
=0D
=0D
=0D
RewriteEngine on=0D
=0D
Options +FollowSymlinks=0D
=0D
RewriteCond %{QUERY_STRING} ^(n=3D[1-2]+)$=0D
=0D
RewriteRule ^/perl.pl$ http://server1/perl.pl?%1 [R,L]=0D
=0D
=0D
=0D
=0D
=0D
This seems to work fine and redirects to server 1 the way I want.=0D
=0D
=0D
=0D
However on server 1 I have it configured with =0D
=0D
=0D
=0D
RewriteEngine on=0D
=0D
Options +FollowSymlinks=0D
=0D
RewriteCond %{QUERY_STRING} ^(n=3D[3]+)$=0D
=0D
RewriteRule ^/perl.pl$ http://server2/perl.pl?%1 [R,L]=0D
=0D
=0D
=0D
=0D
=0D
As I said server 2 seems to work fine, but server 1 I cannot seem to get=0D
to work at all it seems to get in a loop and does nothing.=0D
=0D
Any and all help would be greatly appreciated.=0D
=0D
=0D
=0D
=0D
=0D
=0D
=0D
>From: Igor Cicimov [mailto:icicimov@gmail.com] =0D
>Sent: Thursday, March 11, 2010 12:32 AM=0D
>To: users@httpd.apache.org=0D
>Subject: Re: [users@httpd] rewrite rule=0D
=0D
=0D
=0D
>http://server4/perl.pl?n=3D1 to http://server1/perl.pl?n=3D1=0D
=0D
=0D
>You can't test it on the localhost since you are redirecting some page=0D
to itself =3D> infinite loop=0D
=0D
Try redirecting to some imaginary domain or google.com=0D
=0D
=0D
> RewriteCond %{QUERY_STRING} ^(n=3D[0-9]+)$=0D
> RewriteRule ^/perl.pl$ http://google.com/perl.pl?%1=0D
[R,L]=0D
=0D
>and if the browser gets back the googles 404 page not found and your=0D
address bar looks like >"http://www.google.com/perl.pl?n=3D1" =3D> your rul=
e=0D
is good=0D
=0D
=0D
>Igor=0D
=0D
=0D
=0D
>On Thu, Mar 11, 2010 at 3:56 PM, Nilesh Govindarajan =0D
wrote:=0D
=0D
>On Thu, Mar 11, 2010 at 12:12 AM, Richard Schoenig=0D
> wrote:=0D
> I am new to using mod_rewrite and have been trying to create a rule to=0D
do=0D
> something rather simple, but keep hitting a wall. I have been trying=0D
to=0D
> research online how to do it, but I keep finding global changes and=0D
not=0D
> specific to what I am trying to do. Essentially I am looking to use a=0D
> rewrite rule to redirect users in an application from=0D
>=0D
>=0D
>=0D
> http://server4/perl.pl?n=3D1 to http://server1/perl.pl?n=3D1=0D
>=0D
>=0D
>=0D
>=0D
>=0D
> I tried using=0D
>=0D
> RewriteEngine on=0D
>=0D
> Options +FollowSymlinks=0D
>=0D
> RewriteCond %{QUERY_STRING} ^n=3D1$=0D
>=0D
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
>=0D
> RewriteCond %{QUERY_STRING} ^n=3D2$=0D
>=0D
> RewriteRule ^$ http://127.0.0.1/ perl.pl [L]=0D
>=0D
> RewriteCond %{QUERY_STRING} ^n=3D3$=0D
>=0D
> RewriteRule ^$ http://mypcname/perl.pl [L]=0D
>=0D
>=0D
>=0D
>=0D
>=0D
>=0D
>=0D
> To test on my local host but I am guessing that it is not even close=0D
to what=0D
> I want to do.=0D
>=0D
>=0D
>=0D
>=0D
>=0D
> The information in this email is confidential and may be legally=0D
privileged.=0D
> It is intended solely for the addressee. Access or use by any other=0D
person=0D
> to this internet email is not authorized and may be unlawful. If you=0D
are not=0D
> the intended recipient, please delete or destroy this email. If you do=0D
not=0D
> wish to receive future emails from this sender, please reply directly=0D
to=0D
> this email requesting you be removed from any mailing list.=0D
=0D
You want to redirect or rewrite ?=0D
=0D
--=0D
Nilesh Govindarajan=0D
Site & Server Administrator=0D
www.itech7.com=0D
=0D
------------------------------------------------------------ ---------=0D
The official User-To-User support forum of the Apache HTTP Server=0D
Project.=0D
See for more info.=0D
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org=0D
" from the digest: users-digest-unsubscribe@httpd.apache.org=0D
For additional commands, e-mail: users-help@httpd.apache.org=0D
=0D
=0D
=0D

The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.=0D


------_=_NextPart_001_01CAC133.721C7D1E
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">=0D
=0D
=0D
=
=0D
=0D
=0D
=0D
=0D
=0D
=0D
=0D

=0D
=0D

"sans-serif";=0D
color:#1F497D'>So here is the issue I am having now I have separate servers=
I=0D
am trying to set this rule up on so that if a n=3D1 or an n=3D2 it accesses=
server=0D
1, and if an n=3D3 then it accesses server 2

=0D
=0D

"sans-serif";=0D
color:#1F497D'> 

=0D
=0D

"sans-serif";=0D
color:#1F497D'>The rules I have setup are on server 2 I have it configured =
like=0D
this

=0D
=0D

"sans-serif";=0D
color:#1F497D'><IfModule mod_rewrite.c>

=0D
=0D

"sans-serif";=0D
color:#1F497D'>RewriteEngine on

=0D
=0D

"sans-serif";=0D
color:#1F497D'>Options +FollowSymlinks

=0D
=0D

"sans-serif";=0D
color:#1F497D'>RewriteCond %{QUERY_STRING}  ^(n=3D[1-2]+)$<=
/span>

=0D
=0D

"sans-serif";=0D
color:#1F497D'>RewriteRule ^/perl.pl$ http://server1/perl.pl?%1 [R,L]<=
/o:p>

=0D
=0D

"sans-serif";=0D
color:#1F497D'></IfModule>

=0D
=0D

"sans-serif";=0D
color:#1F497D'> 

=0D
=0D

"sans-serif";=0D
color:#1F497D'>This seems to work fine and redirects to server 1 the way I=
=0D
want.

=0D
=0D

"sans-serif";=0D
color:#1F497D'> 

=0D
=0D

"sans-serif";=0D
color:#1F497D'>However on server 1 I have it configured with pan>

=0D
=0D

"sans-serif";=0D
color:#1F497D'><IfModule mod_rewrite.c>

=0D
=0D

"sans-serif";=0D
color:#1F497D'>RewriteEngine on

=0D
=0D

"sans-serif";=0D
color:#1F497D'>Options +FollowSymlinks

=0D
=0D

"sans-serif";=0D
color:#1F497D'>RewriteCond %{QUERY_STRING}  ^(n=3D[3]+)$ pan>

=0D
=0D

"sans-serif";=0D
color:#1F497D'>RewriteRule ^/perl.pl$ http://server2/perl.pl?%1 [R,L]<=
/o:p>

=0D
=0D

"sans-serif";=0D
color:#1F497D'></IfModule>

=0D
=0D

"sans-serif";=0D
color:#1F497D'> 

=0D
=0D

"sans-serif";=0D
color:#1F497D'>As I said server 2 seems to work fine, but server 1 I cannot=
=0D
seem to get to work at all it seems to get in a loop and does nothing.=

=0D
=0D

"sans-serif";=0D
color:#1F497D'>Any and all help would be greatly appreciated. pan>

=0D
=0D

"sans-serif";=0D
color:#1F497D'> 

=0D
=0D

:auto'> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497D'=

=0D
=0D

"sans-serif";=0D
color:#1F497D'> 

=0D
=0D
0in 0in'>=0D
=0D

> homa","sans-serif"'>From: style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > Igor Cicimov=
=0D
[mailto:icicimov@gmail.com]
=0D
> rif"'>Sent: style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > Thursday, Mar=
ch 11,=0D
2010 12:32 AM
=0D
> rif"'>To: style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >=0D
users@httpd.apache.org
=0D
> rif"'>Subject: style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > Re: [users@ht=
tpd]=0D
rewrite rule

=0D
=0D
=0D
=0D

 

=0D
=0D
n 0in 0in 6.0pt;=0D
margin-left:4.8pt;margin-right:0in'>=0D
=0D

> "_blank">http://server4/perl.pl?n=3D1 =0D
to http://server=
1/perl.pl?n=3D1

=0D
=0D
=0D
=0D


=0D
>You can't test it on the localhost since you are redirecting some page =
to=0D
itself  =3D> infinite loop
=0D

=0D
Try redirecting to some imaginary domain or g=
oogle.com

=0D

=0D

=0D
>    RewriteCond %{QUERY_STRING}  ^(n=3D[0-9]+)$
=
=0D
>    RewriteRule ^/=
$ href=3D"http://google.com/perl.pl?%251">http://google.com/pe rl.pl?%1 [R=
,L]
=0D

=0D
>and if the browser gets back the googles 404 page not found and your=0D
address bar looks like >" =3D1">http://www.google.com/perl.pl?n=3D1"=0D
=3D> your rule is good
=0D

=0D

=0D
>Igor
=0D

=0D

=0D
=0D
=0D
=0D

>On Thu, Mar 11, 2010 at 3:56 PM, Nilesh Govindaraj=
an=0D
<lists@itech7.com<=
/a>>=0D
wrote:

=0D
=0D
=0D
=0D
=0D
=0D

>On Thu, Mar 11, 201=
0 at=0D
12:12 AM, Richard Schoenig
=0D
><
Ric=
hard_Schoenig@picis.com
>=0D
wrote:
=0D
> I am new to using mod_rewrite and have been trying to create a rule to=
do
=0D
> something rather simple, but keep hitting a wall.  I have been tr=
ying=0D
to
=0D
> research online how to do it, but I keep finding global changes and no=
t
=0D
> specific to what I am trying to do.  Essentially I am looking to =
use=0D
a
=0D
> rewrite rule to redirect users in an application from
=0D
>
=0D
>
=0D
>
=0D
> http://serv=
er4/perl.pl?n=3D1
 =0D
to http://server=
1/perl.pl?n=3D1

=0D
>
=0D
>
=0D
>
=0D
>
=0D
>
=0D
> I tried using
=0D
>
=0D
> RewriteEngine on
=0D
>
=0D
> Options +FollowSymlinks
=0D
>
=0D
> RewriteCond %{QUERY_STRING}  ^n=3D1$
=0D
>
=0D
> RewriteRule ^$ http://=
127.0.0.1/
=0D
[L]
=0D
>
=0D
> RewriteCond %{QUERY_STRING}  ^n=3D2$
=0D
>
=0D
> RewriteRule ^$ http://=
127.0.0.1/
=0D
[L]
=0D
>
=0D
> RewriteCond %{QUERY_STRING}  ^n=3D3$
=0D
>
=0D
> RewriteRule ^$ h=
ttp://mypcname/perl.pl
=0D
[L]
=0D
>
=0D
>
=0D
>
=0D
>
=0D
>
=0D
>
=0D
>
=0D
> To test on my local host but I am guessing that it is not even close t=
o=0D
what
=0D
> I want to do.
=0D
>
=0D
>
=0D
>
=0D
>
=0D
>
=0D
> The information in this email is confidential and may be legally=0D
privileged.
=0D
> It is intended solely for the addressee. Access or use by any other pe=
rson
=0D
> to this internet email is not authorized and may be unlawful. If you a=
re=0D
not
=0D
> the intended recipient, please delete or destroy this email. If you do=
not
=0D
> wish to receive future emails from this sender, please reply directly =
to
=0D
> this email requesting you be removed from any mailing list.=

=0D
=0D
=0D
=0D
=0D
=0D

You want to redirect or=
rewrite=0D
?
=0D

=0D
--
=0D
Nilesh Govindarajan
=0D
Site & Server Administrator
=0D

=
=0D

=0D
------------------------------------------------------------ ---------
=
=0D
The official User-To-User support forum of the Apache HTTP Server Project.<=
br>=0D
See <URL: lank">http://httpd.apache.org/userslist.html>=0D
for more info.
=0D
To unsubscribe, e-mail: g"=0D
target=3D"_blank">users-unsubscribe@httpd.apache.org

=0D
  "   from the digest: href=3D"mailto:users-digest-unsubscribe@httpd.apache.org" target=3D"_blank"=
>users-digest-unsubscribe@httpd.apache.org
=0D
For additional commands, e-mail: org"=0D
target=3D"_blank">users-help@httpd.apache.org

=0D
=0D
=0D
=0D

 

=0D
=0D
=0D
=0D
The information in this email is confidential and may be legally privileged=
.. It is intended solely for the addressee. Access or use by any other perso=
n to this internet email is not authorized and may be unlawful. If you are =
not the intended recipient, please delete or destroy this email. If you do =
not wish to receive future emails from this sender, please reply directly t=
o this email requesting you be removed from any mailing list.
=0D
=0D
=0D

------_=_NextPart_001_01CAC133.721C7D1E--

Re: rewrite rule

am 11.03.2010 17:16:19 von Philip Wigg

On 11 March 2010 15:56, Richard Schoenig wrote=
:
> So here is the issue I am having now I have separate servers I am trying =
to
> set this rule up on so that if a n=3D1 or an n=3D2 it accesses server 1, =
and if
> an n=3D3 then it accesses server 2
>
>
>
> The rules I have setup are on server 2 I have it configured like this
>
>
>
> RewriteEngine on
>
> Options +FollowSymlinks
>
> RewriteCond %{QUERY_STRING}=A0 ^(n=3D[1-2]+)$
>
> RewriteRule ^/perl.pl$ http://server1/perl.pl?%1 [R,L]
>
>

>
>
>
> This seems to work fine and redirects to server 1 the way I want.
>
>
>
> However on server 1 I have it configured with
>
>
>
> RewriteEngine on
>
> Options +FollowSymlinks
>
> RewriteCond %{QUERY_STRING}=A0 ^(n=3D[3]+)$
>
> RewriteRule ^/perl.pl$ http://server2/perl.pl?%1 [R,L]
>
>


> As I said server 2 seems to work fine, but server 1 I cannot seem to get =
to
> work at all it seems to get in a loop and does nothing.

Debugging mod_rewrite rules is much easier if you configure a
RewriteLog so you can see what mod_rewrite is actually doing:-

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewrit elog

Also try using curl, fiddler, firebug or some other tool to actually
see what responses you're getting from the server when you make a
request.

-- Phil

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: rewrite rule

am 11.03.2010 17:34:06 von Francis Galiegue

On Thu, Mar 11, 2010 at 16:56, Richard Schoenig
wrote:
> So here is the issue I am having now I have separate servers I am trying =
to
> set this rule up on so that if a n=3D1 or an n=3D2 it accesses server 1, =
and if
> an n=3D3 then it accesses server 2
>
[...]
> RewriteCond %{QUERY_STRING}  ^(n=3D[3]+)$

Why [3]+? 3+ is largely enough. 3 is an atom, like any character
class. And it will match 3, 33, 333, etc, whether it is written [3]+
or 3+, so this is probably not what you want.

Remember that quantifiers (+, *, {...}) apply to the immediately preceding =
atom.
--=20

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: rewrite rule

am 11.03.2010 22:25:16 von Igor Cicimov

--001485e3dee61636f504818d0da5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Just put ^(n=3D3)$ and it will work

On Mar 12, 2010 3:34 AM, "Francis GALIEGUE" wrote:

On Thu, Mar 11, 2010 at 16:56, Richard Schoenig

wrote:

> So here is the issue I am having now I have separate servers I am trying
to > set this rule up on ...
[...]

> RewriteCond %{QUERY_STRING} ^(n=3D[3]+)$
Why [3]+? 3+ is largely enough. 3 is an atom, like any character
class. And it will match 3, 33, 333, etc, whether it is written [3]+
or 3+, so this is probably not what you want.

Remember that quantifiers (+, *, {...}) apply to the immediately preceding
atom.
--

Francis Galiegue
ONE2TEAM
Ing=E9nieur syst=E8me
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincar=E9
75116 Paris

------------------------------------------------------------ --------- The
official User-To-User sup...

--001485e3dee61636f504818d0da5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Just put ^(n=3D3)$ and it will work


On Mar 12, 2010 3:34 AM, "Francis GALIEGU=
E" <> wr=
ote:

On Thu, Mar 11, 2010 at 16:56, Richard Schoenig

< ">Richard_Schoenig@picis.com> wrote:

> So here is the issue I am having=
now I have separate servers I am trying to
> set this rule up on ...

[...]

> RewriteCond %{QUERY_STRING}=A0 ^(n=3D[3]+)$

Why [3]+? 3+ is largely enough. 3 is an atom, like any character=


class. And it will match 3, 33, 333, etc, whether it is written [3]+

or 3+, so this is probably not what you want.



Remember that quantifiers (+, *, {...}) apply to the immediately preceding =
atom.

--



Francis Galiegue

ONE2TEAM

Ing=E9nieur syst=E8me

Mob : +33 (0) 683 877 875

Tel : +33 (0) 178 945 552



40 avenue Raymond Poincar=E9

75116 Paris


------------------------------------------------------------ ---------
The official User-To-User sup...



--001485e3dee61636f504818d0da5--